package com.hgm.secretaccountapp.di

import android.content.Context
import androidx.room.Room
import com.hgm.secretaccountapp.db.AccountDatabase
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton


@Module
@InstallIn(SingletonComponent::class)
object DatabaseModule {

      @Provides
      @Singleton
      fun provideAccountDatabase(@ApplicationContext context: Context): AccountDatabase {
            return Room.databaseBuilder(
                  context,
                  AccountDatabase::class.java,
                  AccountDatabase.DATABASE_NAME
            ).build()
      }

}